package com.sulent.frame.file;

import com.sulent.frame.file.common.enums.FileServerTypeEnum;
import com.sulent.frame.file.impl.FTPFileServer;
import com.sulent.frame.file.impl.HdfsFileServer;
import com.sulent.frame.file.impl.MinioFileServer;
import com.sulent.frame.file.impl.SftpFileServer;

/**
 * @ClassName FileFactory
 * @Description: 文件服务工厂，基于工厂设计模式
 * @Author Submerge.
 * @Since 2024/2/21 10:19
 * @Version 1.0
 */
public class FileServerFactory {


    /**
     * 1.简单工厂
     * @param serverTypeEnum
     * @return
     */
    public static FileServer getFileServer(FileServerTypeEnum serverTypeEnum){
        FileServer fileServer = null;
        String serverType = serverTypeEnum.getServerType();
        switch (serverType){
            case "FTP":
//                fileServer = new FTPFileServer();
                break;
            case "SFTP":
//                fileServer =  new SftpFileServer();
            case "MINIO":
//                fileServer =  new  MinioFileServer();
            case "HDFS":
                fileServer = new  HdfsFileServer();
            default:
                throw new RuntimeException("暂不支持当前文件服务器！");
        }
        return fileServer;

    }


}
